package com.easyim.rest.service.impl;

import com.easyim.rest.config.NeoUtils;
import com.easyim.rest.entity.User;
import com.easyim.rest.service.IUserRelationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class UserRelationServiceImpl implements IUserRelationService {



    @Autowired NeoUtils neoUtils;


    @Override
    public Boolean addFriend(Long user, Long  friend) {
        return null;
    }

    @Override
    public Boolean addFollowing(Long user, Long follows) {
        //todo 加好友 需要发送通知的.
        return neoUtils.addFollowing(user, follows);
    }

    @Override
    public Page<User> getMyFollows(Long user, Integer page, Integer size) {
        List<Long> myFollows = neoUtils.getMyFollowing(user);
        log.info("get user:{} followings result:{}", user, myFollows);
        return null;
    }

    @Override
    public Page<User> whoFollowMe(Long user, Integer page, Integer size) {
        List<Long> myFollows = neoUtils.getFollowsMe(user);
        log.info("get user followings me :{}, result:{}", user, myFollows);
        return null;
    }

}
